home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / mus / play / tracker_4_31.lzh / tracker / prefs.c < prev    next >
C/C++ Source or Header  |  1995-05-11  |  1KB  |  79 lines

  1. /* prefs.c 
  2.     vi:ts=3 sw=3:
  3.  */
  4. /* $Id: prefs.c,v 4.13 1995/05/11 12:25:50 espie Exp espie $
  5.  * $Log: prefs.c,v $
  6.  * Revision 4.13  1995/05/11  12:25:50  espie
  7.  * Corrected types.
  8.  *
  9.  * Revision 4.12  1995/02/21  21:13:16  espie
  10.  * Cleaned up source. Moved minor pieces of code around.
  11.  *
  12.  * Revision 4.11  1995/02/21  17:54:32  espie
  13.  * Internal problem: buggy RCS. Fixed logs.
  14.  *
  15.  * Revision 4.6  1995/02/01  20:41:45  espie
  16.  * Added color.
  17.  *
  18.  */
  19.  
  20. #include "defs.h"
  21. #include "extern.h"
  22. #include "prefs.h"
  23. #include "tags.h"
  24.  
  25. ID("$Id: prefs.c,v 4.13 1995/05/11 12:25:50 espie Exp espie $")
  26. LOCAL void init_prefs P((void));
  27.  
  28. LOCAL void (*INIT)P((void)) = init_prefs;
  29.  
  30. LOCAL struct tag preferences[NUMBER_PREFS];
  31.  
  32. LOCAL void init_prefs()
  33.    {
  34.    int i;
  35.    
  36.    for (i = 0; i < NUMBER_PREFS; i++)
  37.       preferences[i].type = BASE_PREFS + i;
  38.    }
  39.  
  40.  
  41.  
  42. VALUE get_pref(index)
  43. int index;
  44.    {
  45.    INIT_ONCE;
  46.  
  47.    return preferences[index-BASE_PREFS].data;
  48.    }
  49.  
  50. void set_pref(index, value)
  51. int index;
  52. VALUE value;
  53.    {
  54.    preferences[index-BASE_PREFS].data = value;
  55.    }
  56.  
  57. void set_pref_scalar(index, value)
  58. int index;
  59. unsigned long value;
  60.    {
  61.    VALUE temp;
  62.    
  63.    temp.scalar = value;
  64.    set_pref(index, temp);
  65.    }
  66.  
  67. unsigned long get_pref_scalar(index)
  68. int index;
  69.    {
  70.    return get_pref(index).scalar;
  71.    }
  72.  
  73. struct tag *get_prefs()
  74.    {
  75.    INIT_ONCE;
  76.  
  77.    return preferences;
  78.    }
  79.